﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Data.SQLite;
using System.Data;
using System.Data.Common;
using Newtonsoft.Json;
using PDAMain.Entity;
using System.Text.RegularExpressions;
using PDAMain.Interface;

namespace PDAMain.DAL.Dao
{
    class ApplyToRepairDao : BaseDao
    {
        public bool insertApplyRepair(string barCode, string recordeId, string applyTime, string remark, string reason,string locatedid)
        {
            
            bool result = false;
            if (NetWorkState.checkWifiState() || NetWorkState.checkGprsState())
            {
                pdaWebReference.PdaService pda = base.getPdaWebService();
                result = pda.insertApplyRepair(barCode, recordeId, applyTime, remark, reason, locatedid, "1","");

            }
            return result;
        }
        public bool insertLacolTable(string barCode, string recordeId, string applyTime, string remark, string reason,string status, string locatedid, string estdur) 
        {
            bool result = false;
            string str_sql = "insert into  APPLYTOREPAIR (BARCODE ,RECORDE_ID ,APPLY_TIME , REMARK ,REASON,WORKSTATUS,LOCATEDID,ESTDUR) values ('" + barCode + "','" + recordeId + "','" + applyTime + "','" + remark + "','" + reason + "','" + status + "','" + locatedid + "','" + estdur + "')";
            result = base.executeNonQuery(str_sql);
            return result;
        }
    }
}

